Carbon


GetKeyboardFocus

Header: Controls.h Carbon status: Supported

Obtains a handle to the control with the current keyboard focus for a specified window.

OSErr GetKeyboardFocus (
    WindowRef inWindow, 
    ControlRef *outControl
);
inWindow

A pointer to the window for which to obtain keyboard focus.

outControl

On input, a pointer to a ControlHandle value. On return, the ControlHandle value is set to a handle to the control that currently has keyboard focus. Produces NULL if no control has focus.

function result

A result code.

DISCUSSION

The GetKeyboardFocus function returns the handle of the control with current keyboard focus within a specified window.

VERSION NOTES

This function is available with Appearance Manager 1.0 and later.

AVAILABILITY

Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)